# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=rofi-blocks
pkgver=0_git20210123
# Upstream doesn't do releases (https://github.com/OmarCastro/rofi-blocks/issues/25).
_gitrev=c84577749f71f6c0836fc7ca7ec0097d2fe66492
pkgrel=0
pkgdesc="Rofi modi that allows controlling rofi content throug communication with an external program"
url="https://github.com/OmarCastro/rofi-blocks"
arch="all"
license="GPL-3.0-or-later"
depends="cmd:rofi"
makedepends="
	autoconf
	automake
	json-glib-dev
	libtool
	rofi-dev
	"
source="https://github.com/OmarCastro/rofi-blocks/archive/$_gitrev/rofi-blocks-$_gitrev.tar.gz
	fix-missing-include.patch
	fix-check_page_data.patch
	fix-format-long-int.patch
	"
builddir="$srcdir/$pkgname-$_gitrev"

prepare() {
	default_prepare

	autoreconf -i
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make -j1
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
93f988aee9f1fc333b639acb9c6f3769f8e9b4d3a4ff2b996d8d3866ba69ccbfdbdeecabc66b299d904757626bcf1d283943936dcb09439f0c519ddc813eac04  rofi-blocks-c84577749f71f6c0836fc7ca7ec0097d2fe66492.tar.gz
27c5f88809c2e5da814ed06cc91b82ce1267ae134b9dffa7f1685415f5f2404b7bdd607b075d1aa4fa4bcb6b56d52d2d3c9a32866ee648fd765ee431ab2e4b54  fix-missing-include.patch
3a44de8075338ddce2773960f47d7fa8740229a272bb056c0e742a0755e4fc0aa8dbd3f141c0e8d83f547779ae967836cad7d3c4d274951369d75c2c806a5b80  fix-check_page_data.patch
e3435a639d4ac30e30d897e5a3e7dab5e084ef78006e4def8422d5334c8ed2dc7b0b21f0140c21c264279437c1c8fef1e5d4c577fea4da82e9bf181794c0bdaf  fix-format-long-int.patch
"
